package com.etalk.crm.utils;

import org.apache.commons.lang.StringUtils;

/**
 * CrmUtils
 *
 * @author Terwer
 * @version 1.0
 * 2019/4/3 16:58
 **/
public class CrmUtils {
    /**
     * 答案处理
     *
     * @param answer
     * @return
     */
    public static String filterAnswer(String answer) {
        if (StringUtils.isEmpty(answer)) {
            return answer;
        }
        String result = answer.trim().toLowerCase().replaceAll("\\s*|\\t|\\r|\\n", "");
        if (result.endsWith(",")) {
            result = result.substring(0, result.length() - 1);
        }
        return result;
    }
}
